package com.kid.springcloud.service;

import com.kid.springcloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(value = "member-service-nacos-provider"
,fallback = MemberFeignFallbackService.class)
public interface MemberOpenFeignService {
    /*
    *远程调用方式是get，通过接口方式调用
    * 远程调用的url为http://member-service-nacos-provider/member/get/{id}
    * member-service-nacos-provider为nacos注册中心的服务名
    * openfeign根据负载均衡算法来决定调用10004还是10006
     */
    @GetMapping("/member/get/{id}")
    public Result queryById(@PathVariable("id") Long id);

}
